﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="ViewMessage.aspx.cs" Inherits="admin_user_ViewMessage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>View Messages</h1>
                </td>
            </tr>
            <tr>
                <td>
                    User Type : 
                    <asp:DropDownList ID="ddlUserType" runat="server" AutoPostBack="true" onselectedindexchanged="ddlUserType_SelectedIndexChanged">
                        <asp:ListItem Selected="True" Value="0">ALL</asp:ListItem>
                        <asp:ListItem Value="100">SiteAdmin</asp:ListItem>
                        <asp:ListItem Value="200">SiteUser</asp:ListItem>
                        <asp:ListItem Value="300">Provider</asp:ListItem>
                        <asp:ListItem Value="400">Customer</asp:ListItem>
                        <asp:ListItem Value="500">Advertiser</asp:ListItem>
                        <asp:ListItem Value="600">Guest</asp:ListItem>
                    </asp:DropDownList> 
                    <asp:Button ID="btnSearchMessage" runat="server" Text="Search" OnClick="btnSearchMessage_Click" />
                </td>
                <td width="30%" align="right" style="text-align:right;">
                    <asp:Button ID="btnCreatNewMessage" runat="server" Text="Create New Message" OnClick="btnCreatNewMessage_Click" />
                </td>
            </tr>
             <tr>
                <td colspan="2">
                    <asp:GridView ID="grvMessage" runat="server" AllowPaging="True" AllowSorting="True"
                        AutoGenerateColumns="False" Cellspacing="3" CellPadding="3" Width="100%" DataKeyNames="MessageId" DataSourceID="sqlDsMessage"
                        EmptyDataText="There are no data records to display." CssClass="admin_gridstyle" PagerStyle-CssClass="pgr" 
                        GridLines="None" onselectedindexchanged="grvMessage_SelectedIndexChanged">
                        <Columns>
                            <asp:BoundField DataField="MessageId" HeaderText="MessageId" InsertVisible="False"
                                ReadOnly="True" SortExpression="MessageId" Visible="False" />
                            <asp:BoundField DataField="ErrorCode" HeaderText="ErrorCode" ReadOnly="True" SortExpression="ErrorCode" />
                            <asp:BoundField DataField="UserType" HeaderText="User Type" ReadOnly="True" SortExpression="UserType" />
                            <asp:BoundField DataField="MessageDes" HeaderText="Message Type" SortExpression="MessageDes" />
                            <asp:BoundField DataField="Tittle" HeaderText="Tittle" SortExpression="Tittle" />
                            <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                            <asp:CommandField ShowSelectButton="True" SelectText="Edit" />
                            <asp:BoundField DataField="RefCEUserId" HeaderText="RefCEUserId" SortExpression="RefCEUserId"
                                Visible="False" />
                            <asp:BoundField DataField="CreatedDate" HeaderText="CreatedDate" SortExpression="CreatedDate"
                                Visible="False" />
                            <asp:BoundField DataField="ModifiedDate" HeaderText="ModifiedDate" SortExpression="ModifiedDate"
                                Visible="False" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="sqlDsMessage" runat="server" ConnectionString="<%$ ConnectionStrings:CX_DBConnectionString %>"
                        SelectCommand="sprocUserMessagesSelectItemList" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ddlUserType" Name="UserTypeId" PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

